package com.meida.bpm.provider.handler;

import com.meida.bpm.provider.model.TaskRequest;
import com.meida.common.security.OpenUser;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.Task;

import java.util.Map;

/**
 * 任务表单完成处理器
 *
 * @author zyf
 */
public interface TaskCompleteHandler {

    /**
     * 获取任务表单数据
     *
     * @param processInstance
     * @param task
     * @param variables
     * @return
     */
    Map<String, Object> initTaskData(ProcessInstance processInstance, Task task, Map<String, Object> variables);


    /**
     * 任务完成后处理器
     *
     * @param taskRequest
     * @param task
     * @param completeVariables
     */
    void completeAfter(TaskRequest taskRequest, ProcessInstance processInstance, Task task, Map<String, Object> completeVariables, OpenUser user);
}
